Skip to content

fix linting warnings - #9103

Open
Vaivaswat2244 wants to merge 3 commits into
processing:mainfrom
Vaivaswat2244:fix/lint-warnings
Open

fix linting warnings#9103
Vaivaswat2244 wants to merge 3 commits into
processing:mainfrom
Vaivaswat2244:fix/lint-warnings

Conversation

@Vaivaswat2244

@Vaivaswat2244 Vaivaswat2244 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Resolves partially: #9070

Changes:

Fixes all 143 oxlint warnings; npm run lint now exits clean. No lint config was changed. Every warning was resolved in code.

Mostly mechanical:

  • unused imports, variables and orphaned functions removed
  • bare catch {} for unused catch params
  • == → ===
  • // falls through on intentional switch fallthroughs
  • { } around case bodies containing declarations
  • dead if (0) blocks and unreachable post-throw code deleted

One behaviour change worth review: Renderer3D declared remove() twice. The first (canvas teardown, added in 2fa995a) was silently shadowed by a second added later in ef28cbc for _textCanvas, so wrappedElt cleanup has never run. I merged them, Renderer2D.remove() has the identical four lines, which is what it was meant to mirror. WebGL/WebGPU canvases are now actually detached on remove().

Two edits look behavioural but aren't: return FES.internalError(...) is unreachable (it always throws), and if (0) → if (debug) in textCore.js uses a param that arrives falsy.

Screenshots of the change:

image

PR Checklist

  • npm run lint passes
  • [Inline reference] is included / updated — N/A, no public API changes
  • [Unit tests] are included / updated — N/A, no behaviour to cover; existing suites pass unchanged
Verification
  • npm run lint -> 0 warnings (was 143)
  • npm run build -> passes
  • unit-tests -> 2098 passed, 0 failed
  • webgpu p5.Shader + p5.Framebuffer -> 105 passed, 0 failed

WebGPU visual cases and p5.RendererWebGPU were not run locally cuz no software WebGPU adapter available :) leaving those to CI.

@p5-bot

p5-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

Signed-off-by: Vaivaswat <vaivaswat2244@gmail.com>

@ksen0 ksen0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, I did some spot checks. If tests all pass then its fine, however I did see changes in the test suite, could you briefly clarify please?

* Expects an image file and a p5 instance with an image file loaded and drawn
* and checks that they are exactly the same. Sends result to the callback.
*/
var testImageRender = function (file, sketch) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if this is obvious, but why removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was flagged by no-unused-vars in lint CI, which is accurate as written: its only two callers are commented-out tests in this same file ("should draw image with defaults" and "should draw cropped image" ). Both parked behind TODOs about delegating to visual tests and platform-dependent image resizing. So deleting it changed no coverage, but it did strip the scaffolding those TODOs depend on, and it's likely useful whenever someone picks them up.

I'll comment out the helper alongside its callers instead, with a note to restore them together. Lint stays clean, and nothing is lost. Will do the same for createDummyFile in test/unit/dom/dom.js, which was in exactly the same position.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation and update, makes sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants